<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    17-mag-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
     
    $(document).ready(function()
    {
	
    });

    //]]>
</script>
<div class="info">
    <h2>Dettagli Contatto</h2>
    <div>...</div>
</div>
<div class="col2">
    <div id="detailTableLeft">
	<table cellspacing="0" class="table">
	    <caption><strong>Informazioni Contatto</strong></caption>
	    <tbody>
		<tr>
		    <th>Nome:</th>
		    <td><?php echo $this->data['contact_firstname']?> <?php echo $this->data['contact_lastname']?></td>
		</tr>
		<tr>
		    <th>Email Principale:</th>
		    <td><?php echo $this->data['contact_email']?></td>
		</tr>
		<tr>
		    <th>Tel Principale:</th>
		    <td><?php echo $this->data['contact_phone']?></td>
		</tr>
	    </tbody>
	</table>
	<table cellspacing="0" class="table">
	    <caption><strong>Altre Informazioni</strong></caption>
	    <tfoot>
		<tr>
		    <td colspan="2">
			<a class="button" href="/admin/contatti/edit/id/<?php echo $this->data['contact_id'] ?>">Modifica Contatto</a>
		    </td>
		</tr>
	    </tfoot>
	    <tbody>
		<tr>
		    <th>Email 2:</th>
		    <td><?php echo $this->data['contact_email2']?></td>
		</tr>
		<tr>
		    <th>Email 3:</th>
		    <td><?php echo $this->data['contact_email3']?></td>
		</tr>
		<tr>
		    <th>Tel Lavoro:</th>
		    <td><?php echo $this->data['contact_work']?></td>
		</tr>
		<tr>
		    <th>Tel Privato:</th>
		    <td><?php echo $this->data['contact_mobile']?></td>
		</tr>
		<tr>
		    <th>Fax:</th>
		    <td><?php echo $this->data['contact_fax']?></td>
		</tr>
		<tr>
		    <th>Indirizzo:</th>
		    <td>
			<?php 
			if( $this->data['contact_street'] != '' )
			    echo $this->data['contact_street'] .', ';
			
			if( $this->data['contact_street_number'] != '' )
			    echo 'N&deg; '. $this->data['contact_street_number'] .'<br /> ';
			
			if( $this->data['contact_loc'] != '' )
			    echo 'Localit&aacute; '. $this->data['contact_loc'] .'<br />';
			
			if( $this->data['contact_cap'] != '' )
			    echo $this->data['contact_cap'];
			
			if( $this->data['contact_city'] != '' )
			    echo ' <strong>'. strtoupper( $this->data['contact_city'] ) .'</strong> ';
			
			if( $this->data['contact_prov'] != '' )
			    echo '('. $this->province[$this->data['contact_prov']]['short_name'] .')';
			?>
		    </td>
		</tr>
		<tr>
		    <th>Note:</th>
		    <td><?php echo $this->data['contact_notes']?></td>
		</tr>		
	    </tbody>
	</table>	
    </div>

    <div id="detailTableRight">
	<?php if( count( $this->data['contact_roles_locations'] ) OR count( $this->data['contact_roles_partners'] )  ): ?>
	<table class="contact-roles table">
	    <caption>
		<strong>Ruoli</strong>
	    </caption>
	</table>
	    <!--	Locations	-->
	    <?php if( count( $this->data['contact_roles_locations'] ) ): ?>
	    <table class="contact-roles table">
		<?php foreach($this->data['contact_roles_locations'] AS $role ) :?>
		<tr>
		    <td>
			<div class="box">
			    <span class="edit-link">
				<a href="/admin/location/contatti/id/<?php echo $role['location_id'] ?>" title="Modifica Contatti Location">&nbsp;</a>
			    </span>
			    <span class="type location">location</span>
			    <span class="title"><?php echo $role['location_name']?></span>
			    <span class="role"><?php echo $this->contact_roles[$role['fab_contacts_role']]?></span>
			</div>
		    </td>
		</tr>
		<?php endforeach; ?>

	    <?php endif; ?>
	    <!--	Fine Locations	-->
	    <!--	Partners	-->
	    <?php if( count( $this->data['contact_roles_partners'] ) ): ?>

		<?php foreach($this->data['contact_roles_partners'] AS $role ) :?>
		<tr>
		    <td>
			<div class="box">
			    <span class="edit-link">
				<a href="/admin/partners/contatti/id/<?php echo $role['partner_id'] ?>" title="Modifica Contatti Partner">&nbsp;</a>
			    </span>
			    <span class="type partner">partner</span>
			    <span class="extra">extra</span>
			    <span class="title"><?php echo $role['partner_name']?></span>
			    <span class="role"><?php echo $this->contact_roles[$role['fab_contacts_role']]?></span>
			</div>
		    </td>
		</tr>
		<?php endforeach; ?>
	    
	    <?php endif; ?>
	    <!--	Fine Partners	-->
	
	<?php endif; ?>
	</table>
    </div>
</div>
<br style="clear: both;" />

